/**
 * Copyright (C) 2018-2020
 * All rights reserved, Designed By www.yixiang.co
 * 注意：
 * 本软件为www.yixiang.co开发研制
 */
package co.yixiang.modules.shop.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.domain.BaseDomain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author hupeng
 * @date 2020-05-12
 */

@Data
@TableName("yx_store_category")
public class YxStoreCategory extends BaseDomain {

    /**
     * 商品分类表ID
     */
    @ApiModelProperty(value = "商品分类表ID")
    @TableId
    private Integer id;


    /**
     * 父id
     */
    @ApiModelProperty(value = "父id")
    private Integer pid;


    /**
     * 分类名称
     */
    @ApiModelProperty(value = "分类名称")
    @NotBlank(message = "分类名称必填")
    private String cateName;


    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer sort;


    /**
     * 图标
     */
    @ApiModelProperty(value = "图标")
    private String pic;


    /**
     * 是否推荐
     */
    @ApiModelProperty(value = "是否推荐")
    private Integer isShow;


    /*购物返点比率*/
    @ApiModelProperty(value = "购物返点比率")
    private Double profitBackRate;

    /*购物返点开关*/
    @ApiModelProperty(value = "购物返点开关")
    private Integer isProfitBack;


    public void copy(YxStoreCategory source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
